package com.iter.devbox.nio;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;


public class MyNIO {

	public static void main(String[] args) throws IOException {
		File inFile = new File("D:/dev/eclipse/workspace/MyDevBox/nio.txt");
		File outFile = new File("D:/dev/eclipse/workspace/MyDevBox/out-nio.txt");
		
		FileChannel inFC = new FileInputStream(inFile).getChannel();
		FileChannel outFC = new FileOutputStream(outFile).getChannel();
		
		inFC.transferTo(0, inFC.size(), outFC);
		
		inFC.close();
		outFC.close();
	}
}